<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="/common/top::head">
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div th:replace="/common/top::header">

</div>
<div id="Content">
<form method="post" action="/PayController/goAlipay" style="margin: auto;width: fit-content;">
    <input name="cart_id" type="hidden" th:value="${cart.cartId}">
    <input name="item_number" type="hidden" th:value="${itemNumber}">
    <table>
        <tr>
            <td>用户id</td>
            <td th:text="${cart.userId}"></td>
        </tr>
        <tr>
            <td>Item Id</td>
            <td th:text="${cart.itemId}"></td>
        </tr>
        <tr>
            <td>Item Introduction</td>
            <td th:text="${cart.itemIntroduction}"></td>
        </tr>
        <tr>
            <td>地址</td>
            <td>
                <span th:if="${addresses.size()} eq '0'"></span>

                <select name="address" th:unless="${addresses.size()} eq '0'">

                        <option th:value="${address.getAddressContent()}"  th:each="address:${addresses}" th:text="${address.getAddressContent()}"></option>

                </select>
                <a href="AddressController">地址管理</a>

            </td>
        </tr>
        <tr>
            <td>Phone</td>
            <td><input name="order_phone" required type="number"></td>
        </tr>
        <tr>
            <td>收货人姓名</td>
            <td><input name="delivery_name" required type="text"></td>
        </tr>
        <tr>
            <td>Item Price</td>
            <td th:text="${cart.itemPrice}"></td>
        </tr>
        <tr>
            <td>Item Number</td>
            <td th:text="${itemNumber}"></td>
        </tr>
        <tr>
            <td>Total Price</td>
            <td th:text="${cart.itemPrice}*${itemNumber}"></td>
        </tr>
        <tr>
            <td>支付方式</td>
            <td>
                <select name="payment_method" >

                        <option th:value="${paymentMethod}" th:text="${paymentMethod}" th:each="paymentMethod:${paymentMethods}"></option>

                </select>
            </td>
        </tr>

    </table>
    <input type="submit" value="支付">

</form>
</div>
<div th:replace="common/bottom">

</div>
</body>
</html>